<template>
  <div>
    <h2 ref="title">哈哈哈</h2>
    <button @click="btnClick">点击</button>
    <navbar ref="navbar"></navbar>
  </div>
</template>

<script>
import Navbar from "./NavBar.vue";
export default {
  data() {
    return {
      message: "我会app中的message",
    };
  },
  methods: {
    btnClick() {
      console.log(this.$refs.title);
      console.log(this.$refs.navbar.message);
      this.$refs.navbar.navbarMethods();

      // $el
      console.log(this.$refs.navbar.$el);
    },
  },
  components: {
    Navbar,
  },
};
</script>

<style scoped>
</style>